package com.cjl.damin.controller.v1;

import com.cjl.admin.dtos.AdminLoginDto;
import com.cjl.common.dtos.ResponseResult;
import com.cjl.damin.service.AdminService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author cjl
 * @version v1.0
 * @description TODO
 * @createTime 2023/2/19 10:54
 */

@Api(value = "AdminLoginController", description = "管理员登录controller")
@RestController
@RequestMapping("/api/admin/login_auth")
public class AdminLoginController {

    @Autowired
    AdminService adminService;


    @ApiOperation("用户登录")
    @PostMapping("login")
    public ResponseResult login(@RequestBody AdminLoginDto adminLoginDto) {
        return adminService.login(adminLoginDto);
    }


    @ApiOperation("用户登录")
    @PostMapping("modifyPassword")
    public ResponseResult modifyPassword(@RequestBody AdminLoginDto adminLoginDto) {
        return adminService.modifyPassword(adminLoginDto);
    }
}
